Click or drag to resize

KSPDev.ConfigUtils Namespace

A set of the utility methods and classes to make accessing config files easier. You may choose to work with each field indepengly (as you usually do in KSP), and only use the convinience methods. Or you may make use of the meta programming approach and only add the attributes to the fields that require persistence.

If you like dealing with the settings on yourselves, then you may find useful the ConfigAccessor helper class that simplifies the routine operations with the configuration nodes and files.

If you'd like to start using the new attributes system that allows annotation of the settings fields, then you may start from the PersistentFieldAttribute class. This topic has good code examples that will help you to start.

Classes
  ClassDescription
Public classCode exampleAbstractCollectionTypeProto
A base class for a proto of a collection of values.
Public classCode exampleAbstractOrdinaryValueTypeProto
A base class for a proto of a single value.
Public classAbstractPersistentFieldsFileAttribute
A base for any persistent fields file annotation.
Public classCode exampleBasePersistentFieldAttribute
A base for any persitent field annotation.
Public classConfigAccessor
A service class that simplifies accessing configuration files.
Public classGenericCollectionTypeProto
A proto handler for a simple generic collection.
Public classKspTypesProto
A proto for handling all KSP specific types.
Public classPartNodeUtils
Various methods to deal with the config nodes of the parts.
Public classCode examplePersistentFieldAttribute
A simple attribute for the fields that need (de)serialization.
Public classPersistentFieldsDatabaseAttribute
A simple annotation to associate a persistent group with a game's database key.
Public classCode examplePersistentFieldsFileAttribute
A simple annotation to associate a persistent group with a configuration file.
Public classPrimitiveTypesProto
A proto for handling C# primitive types.
Public classStandardOrdinaryTypesProto
Proto to handle all primitive C# types and common Unity/KSP types.
Public classStdPersistentGroups
Group names that have special meaning.
Interfaces
  InterfaceDescription
Public interfaceCode exampleIPersistentField
Interface for the simple types that need custom (de)serialization logic.